package cn.yunbamboos.rest.service.dto.in;

import cn.yunbamboos.rest.service.anno.param.ParamType;
import cn.yunbamboos.rest.service.anno.param.enums.Type;
import com.alibaba.fastjson2.JSONObject;

public class PageInDTO extends GenericInDTO {

    @ParamType(path = "page_no", type = Type.Integer, title = "页码", example = "1")
    private int pageNo;
    @ParamType(path = "page_size", type = Type.Integer, title = "每页条数", example = "10")
    protected int pageSize;

    public PageInDTO() {
        super();
    }

    public void decode(JSONObject json) {
        super.decode(json);
        this.pageNo = this.getIntValue(json, "page_no", 1);
        this.pageSize = this.getIntValue(json, "page_size", 10);
    }

    public int getPageNo() {
        return this.pageNo;
    }

    public int getPageSize() {
        return this.pageSize;
    }
}
